#include "widget.h"
#include "ui_widget.h"
#include <QPainter>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::paintEvent(QPaintEvent *event)
{
    QPainter painter(this);
//    //painter.drawLine(100,100,200,100);
//    //painter.drawRect(100,100,400,300);
//    //painter.drawEllipse(100,100,200,200);
//    QPen pen;
//    pen.setColor(QColor(0,255,255));
//    painter.setPen(pen);
//    //painter.drawRect(100,100,400,300);
//    QBrush brush;
//    brush.setColor(QColor(0,255,0));
//    brush.setStyle(Qt::SolidPattern);
//    painter.setBrush(brush);
//    painter.drawRect(100,100,400,300);
//    QPixmap pixmap(":/dog.jpg");
//    pixmap.scaled(200,200);
//    painter.rotate(180);
//    painter.translate(-400,-300);
//    painter.drawPixmap(100,100,pixmap);
        painter.drawText(100,100,"Hello World!");
}

